#! /usr/bin/env python

####################################
# Generate a connectivity list for #
# a complete graph of N nodes      #
#                                  #
# By Scott Pakin <pakin@lanl.gov>  #
####################################

import sys

# Parse the command line.
if len(sys.argv) != 2:
    sys.stderr.write("Usage: %s <nodes>\n" % sys.argv[0])
    sys.exit(1)
nnodes = int(sys.argv[1])    # Number of vertices in the graph

# Connect every node to every other node.
for i in range(nnodes - 1):
    for j in range(i + 1, nnodes):
        print("%d %d" % (i, j))
